<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>店铺首页</title>
    <link rel="stylesheet" th:href="@{/static/css/minireset.css}" />
    <link rel="stylesheet" th:href="@{/static/css/common.css}" />
    <link rel="stylesheet" th:href="@{/static/css/iconfont.css}" />
    <link rel="stylesheet" th:href="@{/static/css/index.css}" />
    <link rel="stylesheet" th:href="@{/static/css/swiper.min.css}" />
    <script language="JavaScript" th:src="@{/static/script/vue.js}"></script>
    <script language="JavaScript" th:src="@{/static/script/axios.min.js}"></script>
    <script language="JavaScript" th:src="@{/static/script/shop.js}"></script>
</head>
<body>
<div id="app">
    <div class="topbar">
        <div class="w">
            <div class="topbar-right" th:unless="${session.loginuser==null}">
                <!--登录后风格-->
                <span>欢迎你<b th:text="${session.loginuser.getUser_name()}">张总</b></span>
                <a th:href="@{/page.do?operate=page&page=login}" class="register">注销</a>
                <a th:href="@{/cart.do}" class="cart iconfont icon-gouwuche">
                    购物车
                    <div class="cart-num" th:text="${session.loginuser.cart.getKind()}">0</div>
                </a>
                    <a th:href="@{/Commodity.do}" class="register">返回</a>
            </div>
        </div>
    </div>
    <div class="books-list ">
        <div class="w">
            <div class="list">
                <div class="list-header">
                    <div class="title" th:text="${session.seller.user_name}">商品列表</div>
                </div>
                <div class="list-content" id = "index_div">
                    <tr th:if="${#lists.isEmpty(session.commoditylist)}">
                        <td colspan="4">无商品</td>
                    </tr>
                    <div href="" class="list-item" th:each="commodity : ${session.commoditylist}" th:object="${commodity}">
                        <img th:src="@{|/static/uploads/*{commodity_IMG}|}" alt="">
                        <p th:text="|商品名:*{commodity_name}|">书名:活着</p>
                        <p th:text="|价格:￥*{price}|">价格:￥66.6</p>
                        <p th:text="|销量:*{saleCount}|">销量:230</p>
                        <p th:text="|库存:*{inventory}|">库存:1000</p>
                        <p th:text="|ID:*{commodity_ID}|">库存:1000</p>
                        <p th:if="*{state==0}">未上架</p>
                        <p th:if="*{state==02}">已被强制下架</p>
                        <p th:if="*{state==03}">商家已重新提交商品信息</p>
                        <button th:unless="${session.loginuser.role==0}" th:onclick="|addCart(*{commodity_ID})|">加入购物车</button>
                        <button th:if="${session.loginuser.role==0} and *{state==1}"
                                th:onclick="|bancommodity(*{commodity_ID},'02')|">强制下架</button>
                        <button th:if="${session.loginuser.role==0} and *{state==02}"
                                th:onclick="|bancommodity(*{commodity_ID},'0')|">取消强制下架</button>
                        <button th:if="${session.loginuser.role==0} and *{state==03}"
                                th:onclick="|bancommodity(*{commodity_ID},'0')|">审核通过</button>
                        <button th:if="${session.loginuser.role==0} and *{state==03}"
                                th:onclick="|bancommodity(*{commodity_ID},'04')|">审核不通过</button>
                    </div>
                </div>

            </div>
        </div>

    </div>
    <div class="cate w">
        <div class="list">
            <a href="" class="list-item">
                <i class="iconfont icon-java"></i>
                <span>java</span>
            </a>
            <a href="" class="list-item"
            ><i class="iconfont icon-h5"></i>h5</a
            >
            <a href="" class="list-item">
                <i class="iconfont icon-python"></i>python
            </a>
            <a href="" class="list-item"
            ><i class="iconfont icon-tianchongxing-"></i>pm</a
            >
            <a href="" class="list-item"
            ><i class="iconfont icon-php_elephant"></i>php</a
            >
            <a href="" class="list-item"
            ><i class="iconfont icon-go"></i>go</a
            >
        </div>
        <a href="" class="img">
            <img src="./static/uploads/cate4.jpg" alt="" />
        </a>
        <a href="" class="img">
            <img src="./static/uploads/cate5.jpg" alt="" />
        </a>
        <a href="" class="img">
            <img src="./static/uploads/cate6.jpg" alt="" />
        </a>
    </div>
    <div class="books">
        <div class="w">
            <div class="seckill">
                <div class="seckill-header">
                    <div class="title">
                        图书秒杀
                    </div>
                </div>
                <div class="seckill-content">

                    <a href="" class="tip">
                        <h5>距离结束还有</h5>
                        <i class="iconfont icon-shandian"></i>
                        <div class="downcount">
                            <span class="time">00</span>
                            <span class="token">:</span>
                            <span class="time">00</span>
                            <span class="token">:</span>
                            <span class="time">00</span>
                        </div>
                    </a>


                    <a href="" class="books-sec">
                        <img src="./static/uploads/congwanqingdaominguo.jpg" alt="">
                        <p>从晚晴到民国</p>
                        <div>
                            <span class="cur-price">￥28.9</span>
                            <span class="pre-price">￥36.5</span>
                        </div>
                        <button>立即购买</button>
                    </a>
                    <a href="" class="books-sec">
                        <img src="./static/uploads/cyuyanrumenjingdian.jpg" alt="">
                        <p>c语言入门经典</p>
                        <div>
                            <span class="cur-price">￥55.9</span>
                            <span class="pre-price">￥68.5</span>
                        </div>
                        <button>立即购买</button>
                    </a>
                    <a href="" class="books-sec">
                        <img src="./static/uploads/fusang.jpg" alt="">
                        <p>扶桑</p>
                        <div>
                            <span class="cur-price">￥30.9</span>
                            <span class="pre-price">￥47.5</span>
                        </div>
                        <button>立即购买</button>
                    </a>
                    <a href="" class="books-sec">
                        <img src="./static/uploads/geihaizideshi.jpg" alt="">
                        <p>给孩子的诗</p>
                        <div>
                            <span class="cur-price">￥18.9</span>
                            <span class="pre-price">￥25.5</span>
                        </div>
                        <button>立即购买</button>
                    </a>
                    </ul>
                </div>
            </div>
        </div>
    </div>

</div>
<script src="./static/script/swiper.min.js"></script>
<script>
    var swiper = new Swiper('.swiper-container', {
        autoplay: true,
        pagination: {
            el: '.swiper-pagination',
            dynamicBullets: true
        },
        navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev'
        }
    })
</script>
</body>
</html>